 package com.farm.resume.service.impl;
 
 import com.farm.core.auth.domain.LoginUser;
 import com.farm.core.sql.query.DataQuery;
 import com.farm.core.time.TimeTool;
 import com.farm.resume.dao.ResumeworkDaoInter;
 import com.farm.resume.domain.Resumework;
 import com.farm.resume.service.ResumeworkServiceInter;
 import java.util.List;
 import javax.annotation.Resource;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 
 
 
 
 
 
 
 
 
 
 
 @Service
 public class ResumeworkServiceImpl
   implements ResumeworkServiceInter
 {
   @Resource
   private ResumeworkDaoInter resumeworkDaoImpl;
   private static final Logger log = Logger.getLogger(ResumeworkServiceImpl.class);
   
   @Transactional
   public Resumework insertResumeworkEntity(Resumework entity, LoginUser user)
   {
     entity.setCuser(user.getId());
     entity.setCtime(TimeTool.getTimeDate14());
     entity.setCusername(user.getName());
     entity.setEuser(user.getId());
     entity.setEusername(user.getName());
     entity.setEtime(TimeTool.getTimeDate14());
     entity.setPstate("1");
     return this.resumeworkDaoImpl.insertEntity(entity);
   }
   
 
   @Transactional
   public Resumework editResumeworkEntity(Resumework entity, LoginUser user)
   {
     Resumework entity2 = this.resumeworkDaoImpl.getEntity(entity.getId());
     entity2.setEuser(user.getId());
     entity2.setEusername(user.getName());
     entity2.setEtime(TimeTool.getTimeDate14());
     entity2.setEproperty(entity.getEproperty());
     entity2.setEscale(entity.getEscale());
     entity2.setWorknote(entity.getWorknote());
     entity2.setSalary(entity.getSalary());
     entity2.setDateend(entity.getDateend());
     entity2.setDatestart(entity.getDatestart());
     entity2.setPostname(entity.getPostname());
     entity2.setName(entity.getName());
     entity2.setType(entity.getType());
     entity2.setUserid(entity.getUserid());
     entity2.setPcontent(entity.getPcontent());
     
 
 
 
 
 
 
 
     this.resumeworkDaoImpl.editEntity(entity2);
     return entity2;
   }
   
 
   @Transactional
   public void deleteResumeworkEntity(String id, LoginUser user)
   {
     this.resumeworkDaoImpl.deleteEntity(this.resumeworkDaoImpl.getEntity(id));
   }
   
 
   @Transactional
   public Resumework getResumeworkEntity(String id)
   {
     if (id == null) {
       return null;
     }
     return this.resumeworkDaoImpl.getEntity(id);
   }
   
 
   @Transactional
   public DataQuery createResumeworkSimpleQuery(DataQuery query)
   {
     DataQuery dbQuery = DataQuery.init(query, "FARM_RESUME_WORK", 
       ",EPROPERTY,ESCALE,WORKNOTE,SALARY,DATEEND,DATESTART,POSTNAME,NAME,TYPE,USERID,PCONTENT,PSTATE,EUSER,EUSERNAME,CUSER,CUSERNAME,ETIME,CTIME,ID");
     return dbQuery;
   }
   
   public ResumeworkDaoInter getResumeworkDaoImpl()
   {
     return this.resumeworkDaoImpl;
   }
   
   public void setResumeworkDaoImpl(ResumeworkDaoInter dao) {
     this.resumeworkDaoImpl = dao;
   }
   
   @Transactional
   public List<Resumework> getResumeworkEntitysByUserId(String userid)
   {
     return this.resumeworkDaoImpl.getResumeworkEntitysByUserId(userid);
   }
 }

